<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<title>123</title>
		<script src="//cdn.bootcss.com/jquery/1.11.1/jquery.js"></script>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=FPTNyn1QvwkNGaX86RGSDAjL"></script>
		<script src="../js/echarts/build/dist/echarts.js" type="text/javascript"></script>
	    <script type="text/javascript" src="../js/range-data.js"></script>
	    <script type="text/javascript" src="../js/zone-data.js"></script>
	    <script src="http://api.map.baidu.com/library/AreaRestriction/1.2/src/AreaRestriction_min.js"></script> 
  		<script>
		require.config({
			paths: {
				echarts: "../js/echarts/build/dist",
			}
		});	
		require(
		[
			'echarts', // 代指echarts设置的路径，即'../resource/build/dist'
			'echarts/chart/main', // 使用柱状图就加载bar模块，按需加载,引入bar.js
			'echarts/chart/map',// 加载地图,引入funnel.js文件, 按需加载,		
		],
		function(ec,BMapExtension) {
				var USERTHEME = "midnight";
				var _line, _lineEffect, _range, _rangeFill, _rangeStroke;
	            switch(USERTHEME){
	                case 'midnight': default:
                        // 流动线
                        _line = '#FFD924';
                        _lineEffect = 'rgba(255, 217, 36, 0.4)';
                        // 地图区域
                        _range = '#008DFF';
                        // hover填充色
                        _rangeFill = '#008DFF';
                        // hover边框色
                        _rangeStroke = 'blue';
                        break;
                    case 'simple':
                        _line = '#F5511F';
                        _lineEffect = 'rgba(245, 81, 31, 0.4)';
                        _range = '#1A70FF';
                        _rangeFill = '#96BDFC';
                        _rangeStroke = '#8FB1E1';
                        break;
	            }     
                window.BMapExt = new BMapExtension($('#main')[0], BMap, ec,{
                    enableMapClick: false
                });
                window.map = BMapExt.getMap();
                 //百度地图功能
                map.enableScrollWheelZoom(); //允许滚轮缩放
                map.enableKeyboard();
                map.disableDoubleClickZoom();
                map.setMinZoom(11);
                map.setMaxZoom(14);        
				var i_loc_var_initZoom=12;      


                map.centerAndZoom(new BMap.Point(118.301624,31.355314), i_loc_var_initZoom);
        		 var polygon = new BMap.Polygon([
						new BMap.Point(118.301624,31.455314),
						new BMap.Point(118.402624,31.358314),
						new BMap.Point(118.301624,31.358314),
						new BMap.Point(118.402624,31.455314),
					], {strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});  //创建多边形
        		 map.addOverlay(polygon);  
        		  polygon.addEventListener("click", function(e){
                    	alert("134");
                    });
        		  window.option = {};  
				//var container = BMapExt.getEchartsContainer();	     
         		//var myChart = BMapExt.initECharts(container);
        		//BMapExt.setOption(option);
				
			
          
		
			}
		)

		
		
	</script>
	</head>
	<body>
	<div id="main" style="width: 1366px;height: 768px;"></div>
	
</body>
</html>
